package cn.wegoteam.shop.action;

import java.util.List;

import org.apache.struts2.convention.annotation.Action;
import org.apache.struts2.convention.annotation.Namespace;
import org.apache.struts2.convention.annotation.ParentPackage;
import org.apache.struts2.convention.annotation.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import cn.wegoteam.shop.action.BaseAction;
import cn.wegoteam.shop.inter.CartServiceInter;
import cn.wegoteam.shop.inter.PayImpServiceInter;
import cn.wegoteam.shop.inter.PayServiceInter;
import cn.wegoteam.shop.po.Cart;
import cn.wegoteam.shop.po.Order;
import cn.wegoteam.shop.service.AlipayService;
import cn.wegoteam.shop.util.Const;
import cn.wegoteam.shop.util.PostAndGetRequset;

@ParentPackage("default")
@Namespace("/")
@Controller
public class OrderAction extends BaseAction<Order> {
	
	private static final long serialVersionUID = -7214652284224332303L;
	@Autowired
	private PayServiceInter payService;
	@Autowired
	private CartServiceInter cartService;
	
	/**
	 * 支付宝异步通知
	 */
	@Action(value = "alipayNotify")
	public void alipayNotify() {
		PayImpServiceInter payImpService = new AlipayService();
		payImpService.payReturn(payService,request);
		writeStringToResponse("success");
	}
}
